package com.example.entreamigoslocal;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class RedirecionaActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_redireciona);
		
		Intent intent  = getIntent ();
		int city = intent.getIntExtra("POSITION",0);
		
		
		switch (city) {
		case 0:
			Intent i0 = new Intent(this, NovoEventoActivity.class);
			startActivity(i0);	
			finish();
			break;
	
		case 1:
			Intent i1 = new Intent(this, ListarEventoActivity.class);
			startActivity(i1);	
			finish();
			break;
			
		case 2:
			Intent i2 = new Intent(this, SobreActivity.class);
			startActivity(i2);	
			finish();
			break;
		
		case 3:
			Intent i3 = new Intent(this, LoginActivity.class);
			startActivity(i3);
			finish();
			break;

		default:
			break;
		}
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.redireciona, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
